package com.objectville.tour.rmi.server;
import java.net.MalformedURLException;
import java.rmi.AlreadyBoundException;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class MyRemoteImpl extends UnicastRemoteObject implements MyRemote {

	/**
	 * 
	 */
	private static final long serialVersionUID = 2873137596630404215L;

	public MyRemoteImpl() throws RemoteException {
	}

	public String sayHello() {
		return "Server says, 'Hey'";
	}

	public static void main(String[] args) {
		MyRemote service;
		try {
			service = new MyRemoteImpl();
			Naming.bind("RemoteHello", service);
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (AlreadyBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}
